﻿<%@ Page Title="用户个人信息" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="UserIndex.aspx.cs" Inherits="RegexLib.Web.Views.User.UserIndex" %>
<asp:Content ID="Content1" ContentPlaceHolderID="headContentPlaceHolder" runat="server">
	<link rel="Stylesheet" type="text/css" href="/Content/styles/RxView.css"/>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="LeftBar1ContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<% UserInfo curuser = RxMembership.GetCurrentUser(); %>
<% UserInfo user = (UserInfo)ViewData["User"]; %>
<% KeywordInfo[] keywords = (KeywordInfo[])ViewData["Keywords"]; %>
<% RegexInfo[] regexes = (RegexInfo[])ViewData["Regexes"]; %>
<% int pageIndex = (int)ViewData["PageIndex"]; %>
<% int pageSize = (int)ViewData["PageSize"]; %>
<% int totalPages = (int)ViewData["TotalPages"]; %>
<% string userPerfix = curuser != null && curuser.UserId == user.UserId ? "我" : HttpUtility.HtmlEncode(user.Nickname); %>
<div class="box">
	<div class="bt"><%= userPerfix %>使用的关键字</div>
	<div class="bc">
<% for (int i = 0; i < keywords.Length; i++) %>
<% { %>
		<a href='<%= RxUrl.GetViewKeywordUrl(keywords[i].Text) %>'><%= HttpUtility.HtmlEncode(keywords[i].Text) %></a>
		<% if (i < keywords.Length - 1) %>
		<% { %>
			|
		<% } %>
<% } %>
	</div>
</div>
<div class="box">
	<div class="bt"><%= userPerfix %>添加的正则表达式</div>
	<div class="bc">
<% foreach (var rx in regexes) %>
<% { %>
	<h3><a href='<%= RxUrl.GetViewRegexUrl(rx.AccessKey) %>'><%= HttpUtility.HtmlEncode(rx.Title) %></a></h3>
	<p><%= HttpUtility.HtmlEncode(rx.Description.LimitLength(200)) %></p>
	<hr />
<% } %>
<% for (int pi = 1; pi <= totalPages; pi++) %>
<% { %>
	<% if (pi == pageIndex) %>
	<% { %>
		<span class="rx-curpg"><%= pi %></span>
	<% } %>
	<% else %>
	<% { %>
		<span class="rx-pg"><a href='<%= RxUrl.GetUserUrl(user.AccessKey, pi, pageSize) %>'><%= pi %></a></span>
	<% } %>
<% } %>
	</div>
</div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">
</asp:Content>
